package com.ruoyi.bargain.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bargain.mapper.BargainMapper;
import com.ruoyi.bargain.domain.Bargain;
import com.ruoyi.bargain.service.IBargainService;
import com.ruoyi.common.support.Convert;

/**
 * 砍价活动 服务层实现
 * 
 * @author lzy
 * @date 2019-03-07
 */
@Service
public class BargainServiceImpl implements IBargainService 
{
	@Autowired
	private BargainMapper bargainMapper;

	/**
     * 查询砍价活动信息
     * 
     * @param id 砍价活动ID
     * @return 砍价活动信息
     */
    @Override
	public Bargain selectBargainById(String id)
	{
	    return bargainMapper.selectBargainById(id);
	}
	
	/**
     * 查询砍价活动列表
     * 
     * @param bargain 砍价活动信息
     * @return 砍价活动集合
     */
	@Override
	public List<Bargain> selectBargainList(Bargain bargain)
	{
	    return bargainMapper.selectBargainList(bargain);
	}
	
    /**
     * 新增砍价活动
     * 
     * @param bargain 砍价活动信息
     * @return 结果
     */
	@Override
	public int insertBargain(Bargain bargain)
	{
	    return bargainMapper.insertBargain(bargain);
	}
	
	/**
     * 修改砍价活动
     * 
     * @param bargain 砍价活动信息
     * @return 结果
     */
	@Override
	public int updateBargain(Bargain bargain)
	{
	    return bargainMapper.updateBargain(bargain);
	}

	/**
     * 删除砍价活动对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteBargainByIds(String ids)
	{
		return bargainMapper.deleteBargainByIds(Convert.toStrArray(ids));
	}


	
}
